VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Object = "{7B78673D-6A82-11D7-ADA7-887C5F370755}#1.0#0"; "menu.ocx"
Object = "{736A8444-E374-41A8-B526-1B07FD2F3F5B}#1.0#0"; "BLacKPeaRLOCX.ocx"
Begin VB.Form FrmProc 
   BackColor       =   &H80000007&
   BorderStyle     =   0  'None
   Caption         =   "List Processes Client"
   ClientHeight    =   6375
   ClientLeft      =   0
   ClientTop       =   -30
   ClientWidth     =   5175
   Icon            =   "FrmProc.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6375
   ScaleWidth      =   5175
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin BLacKPeaRLOCX.BLacKFrame BLacKFrame6 
      Height          =   1455
      Left            =   120
      TabIndex        =   5
      Top             =   4560
      Width           =   4935
      _ExtentX        =   8705
      _ExtentY        =   2566
      BackColor1      =   0
      BackColor2      =   4210752
      BackGradient    =   0
      Caption         =   ""
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   255
      TitleColor1     =   4210752
      TitleColor2     =   0
      TitleGradient   =   0
      TitleHeight     =   200
      BorderColor     =   49152
      Begin VB.TextBox Txtnoclient 
         BackColor       =   &H00404040&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H0000C000&
         Height          =   250
         Left            =   1230
         TabIndex        =   0
         Top             =   285
         Width           =   495
      End
      Begin BLacKPeaRLOCX.ButtonNix CmdRefresh 
         Height          =   495
         Left            =   2040
         TabIndex        =   3
         Top             =   720
         Width           =   1395
         _ExtentX        =   2461
         _ExtentY        =   873
         BTYPE           =   5
         TX              =   "Refresh"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmProc.frx":B532
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin BLacKPeaRLOCX.ButtonNix CmdTutup 
         Height          =   495
         Left            =   3360
         TabIndex        =   4
         Top             =   720
         Width           =   1395
         _ExtentX        =   2461
         _ExtentY        =   873
         BTYPE           =   5
         TX              =   "Tutup"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmProc.frx":B54E
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin BLacKPeaRLOCX.ButtonNix CmdRemote 
         Height          =   495
         Left            =   2040
         TabIndex        =   1
         Top             =   240
         Width           =   1395
         _ExtentX        =   2461
         _ExtentY        =   873
         BTYPE           =   5
         TX              =   "View Process"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmProc.frx":B56A
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin BLacKPeaRLOCX.ButtonNix CmdKill 
         Height          =   495
         Left            =   3360
         TabIndex        =   2
         Top             =   240
         Width           =   1395
         _ExtentX        =   2461
         _ExtentY        =   873
         BTYPE           =   5
         TX              =   "Kill Process"
         ENAB            =   -1  'True
         BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         COLTYPE         =   2
         FOCUSR          =   0   'False
         BCOL            =   1184274
         BCOLO           =   16777215
         FCOL            =   49152
         FCOLO           =   49152
         MCOL            =   12632256
         MPTR            =   1
         MICON           =   "FrmProc.frx":B586
         UMCOL           =   -1  'True
         SOFT            =   0   'False
         PICPOS          =   0
         NGREY           =   0   'False
         FX              =   0
         HAND            =   0   'False
         CHECK           =   0   'False
         VALUE           =   0   'False
      End
      Begin VB.Shape Shape10 
         BackColor       =   &H00004040&
         BackStyle       =   1  'Opaque
         BorderColor     =   &H00C0FFC0&
         Height          =   345
         Left            =   1200
         Shape           =   4  'Rounded Rectangle
         Top             =   240
         Width           =   570
      End
      Begin VB.Label LabelTotal 
         BackStyle       =   0  'Transparent
         ForeColor       =   &H00FFFFFF&
         Height          =   615
         Left            =   240
         TabIndex        =   9
         Top             =   600
         Width           =   1815
      End
      Begin VB.Label Label1 
         BackStyle       =   0  'Transparent
         Caption         =   "Nomor Client"
         ForeColor       =   &H0000C000&
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   240
         Width           =   1095
      End
   End
   Begin HookMenu.ctxHookMenu ctxHookMenu1 
      Left            =   1560
      Top             =   7440
      _ExtentX        =   900
      _ExtentY        =   900
      BmpCount        =   3
      Bmp:1           =   "FrmProc.frx":B5A2
      Mask:1          =   16645369
      Key:1           =   "#MnuView"
      Bmp:2           =   "FrmProc.frx":B9CA
      Key:2           =   "#MnuKill"
      Bmp:3           =   "FrmProc.frx":D732
      Mask:3          =   12632256
      Key:3           =   "#MnuRefresh"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin BLacKPeaRLOCX.BLacKFrame BLacKFrame1 
      Height          =   6375
      Left            =   0
      TabIndex        =   7
      Top             =   0
      Width           =   5175
      _ExtentX        =   9128
      _ExtentY        =   11245
      BackColor1      =   0
      BackColor2      =   0
      BackGradient    =   0
      Caption         =   "List Processes Client"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   49152
      TitleColor1     =   4210752
      TitleColor2     =   0
      TitleGradient   =   0
      TitleHeight     =   200
      BorderColor     =   49152
      BorderWidth     =   2
      Begin MSFlexGridLib.MSFlexGrid Grid 
         Height          =   4215
         Left            =   120
         TabIndex        =   8
         Top             =   240
         Width           =   4935
         _ExtentX        =   8705
         _ExtentY        =   7435
         _Version        =   393216
         FixedCols       =   0
         BackColor       =   0
         ForeColor       =   49152
         ForeColorFixed  =   32768
         FocusRect       =   2
         Appearance      =   0
      End
   End
End
Attribute VB_Name = "FrmProc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CmdKill_Click()
On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(Txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = sckConnected Then
            If Grid.Rows > 1 Then
                FrmMain.Winsock(rec(2)).SendData "endproccess|" & Grid.TextMatrix(Grid.Row, 1) & "|_|_|_|_|_|"
            End If
        End If
    End If
    rec.Close
    Call CmdRemote_Click
IfNoErr:
Exit Sub
hell:
'MsgBox "An Error In " & Me.Name & ". See Error.log for detail", vbCritical, "Error Handling"
 TulisError Err.Description, Err.Number, "CmdKill_Click", Me.Name
 Resume IfNoErr

End Sub
Private Sub CmdRefresh_Click()
On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(Txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = sckConnected Then
            FrmMain.Winsock(rec(2)).SendData "taskman|_|_|_|_|_|_|"
        End If
    End If
    rec.Close
IfNoErr:
Exit Sub
hell:
'MsgBox "An Error In " & Me.Name & ". See Error.log for detail", vbCritical, "Error Handling"
 TulisError Err.Description, Err.Number, "CmdRefresh_Click", Me.Name
 Resume IfNoErr

End Sub
Private Sub CmdRemote_Click()
On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(Txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = sckConnected Then
            FrmMain.Winsock(rec(2)).SendData "taskman|_|_|_|_|_|_|"
        End If
    End If
    rec.Close
IfNoErr:
Exit Sub
hell:
'MsgBox "An Error In " & Me.Name & ". See Error.log for detail", vbCritical, "Error Handling"
 TulisError Err.Description, Err.Number, "CmdRemote_Click", Me.Name
 Resume IfNoErr

End Sub
Private Sub CmdTutup_Click()
    Unload Me
End Sub

Private Sub Form_Load()
StyleS
End Sub

Private Sub Form_Unload(Cancel As Integer)
On Error GoTo hell
    rec.Open "SELECT ip.*,port.port FROM ip,port WHERE ip.ip = port.ip AND ip.no_client = " & Val(Txtnoclient.Text), conn, adOpenStatic, adLockOptimistic
    If Not rec.RecordCount = 0 Then
        If FrmMain.Winsock(rec(2)).State = sckConnected Then
            FrmMain.Winsock(rec(2)).SendData "staskman|_|_|_|_|_|_|"
        End If
    End If
    rec.Close
IfNoErr:
Exit Sub
hell:
'MsgBox "An Error In " & Me.Name & ". See Error.log for detail", vbCritical, "Error Handling"
 TulisError Err.Description, Err.Number, "CmdRemote_Click", Me.Name
 Resume IfNoErr

End Sub

Private Sub Grid_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 2 Then
    Dim Pt As POINTAPI
    Dim ret As Long
    RMenu = CreatePopupMenu()

    AppendMenu RMenu, MF_STRING, 1, "View Process"
    AppendMenu RMenu, MF_STRING, 2, "Kill Process"
    
    AppendMenu RMenu, MF_STRING, 3, "Refresh List"
    AppendMenu RMenu, MF_SEPARATOR, 5, ByVal 0&
    AppendMenu RMenu, MF_STRING, 4, "E&xit"

    GetCursorPos Pt
    ret = TrackPopupMenuEx(RMenu, TPM_LEFTALIGN Or TPM_RETURNCMD Or TPM_RIGHTBUTTON, Pt.X, Pt.Y, Me.hWnd, ByVal 0&)
   Select Case ret
   Case 1
   Call CmdRemote_Click

   Case 2
   Call CmdKill_Click

    Case 3
  Call CmdRefresh_Click
Case 4
  Unload Me
   End Select

   End If
End Sub




Private Sub StyleS()
On Error Resume Next
Dim ctrl As Control
For Each ctrl In Controls
If FrmStyles.txtnamastyle.Text = "Default" Then
Exit Sub
Else
    If (TypeOf ctrl Is ButtonNix) And _
        ctrl.Name <> "cmdSwitchStyle" Then
        ctrl.ButtonType = FrmStyles.txtlButtonType.Text
        ctrl.ColorScheme = FrmStyles.txtlColorScheme.Text
        ctrl.Backcolor = FrmStyles.txtlBackcolor.Text
        ctrl.BackOver = FrmStyles.txtlBackOver.Text
        ctrl.Forecolor = FrmStyles.txtlForecolor.Text
        ctrl.ForeOver = FrmStyles.txtlForeOver.Text
       
    End If
        If (TypeOf ctrl Is BLacKFrame) And _
        ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.BackColor1 = FrmStyles.frameBackColor1.Text
         ctrl.BackColor2 = FrmStyles.frameBackColor2.Text
         ctrl.BorderColor = FrmStyles.frameBorderColor.Text
         ctrl.Forecolor = FrmStyles.frameForecolor.Text
         ctrl.TitleColor1 = FrmStyles.frameTitleColor1.Text
         ctrl.TitleColor2 = FrmStyles.frameTitleColor2.Text
         If FrmStyles.frameBackGradient.Text = 0 Then
         ctrl.BackGradient = None
         ElseIf FrmStyles.frameBackGradient.Text = 1 Then
         ctrl.BackGradient = Vertical
         ElseIf FrmStyles.frameBackGradient.Text = 2 Then
         ctrl.BackGradient = Horizontal
         End If
         
         If FrmStyles.Frametitlegradient.Text = 0 Then
         ctrl.TitleGradient = None
         ElseIf FrmStyles.Frametitlegradient.Text = 1 Then
         ctrl.TitleGradient = Vertical
         ElseIf FrmStyles.Frametitlegradient.Text = 2 Then
         ctrl.TitleGradient = Horizontal
         End If

    End If
        If (TypeOf ctrl Is BLacKText) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.TForecolor.Text
         ctrl.Backcolor = FrmStyles.TBackcolor.Text
         ctrl.BackColorMain = FrmStyles.TBackColorMain.Text
         ctrl.BorderColor = FrmStyles.TBorderColor.Text
         ctrl.FocusBackColor = FrmStyles.TFocusBackColor.Text
         ctrl.FocusBackMainColor = FrmStyles.TFocusBackMainColor.Text
         ctrl.FocusBorderColor = FrmStyles.TFocusBorderColor.Text
         ctrl.FocusForeColor = FrmStyles.TFocusForeColor.Text
    End If
        If (TypeOf ctrl Is MSFlexGrid) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.GDBackcolor.Text
         ctrl.BackColorBkg = FrmStyles.GDBackColorBkg.Text
         ctrl.BackColorSel = FrmStyles.GDBackColorSel.Text
         ctrl.BackColorFixed = FrmStyles.GDBackColorFixed.Text
         ctrl.ForeColorSel = FrmStyles.GDForeColorSel.Text
         ctrl.Forecolor = FrmStyles.GDForecolor.Text
         ctrl.ForeColorFixed = FrmStyles.GDForeColorFixed.Text
         ctrl.GridColor = FrmStyles.GDGridColor.Text
         ctrl.GridColorFixed = FrmStyles.GDGridColorFixed.Text
    End If
        If (TypeOf ctrl Is TextBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.lbltextfore.Text
         ctrl.Backcolor = FrmStyles.lbltextback.Text
    End If
        If (TypeOf ctrl Is ComboBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.cboForeColor.Text
         ctrl.Backcolor = FrmStyles.cboBackcolor.Text
    End If
        If (TypeOf ctrl Is Label) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.lblForeColor.Text
    End If
        If (TypeOf ctrl Is RichTextBox) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.RcBackcolor.Text
    End If
    
            If (TypeOf ctrl Is OptionButton) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Forecolor = FrmStyles.opForecolor.Text
         ctrl.Backcolor = FrmStyles.opBackcolor.Text
    End If
            If (TypeOf ctrl Is ListView) And _
         ctrl.Name <> "cmdSwitchStyle" Then
         ctrl.Backcolor = FrmStyles.LBackColor.Text
    End If
    Me.Backcolor = FrmStyles.WFore.Text
    End If
Next ctrl
End Sub

Private Sub txtnoclient_Change()
If Val(Txtnoclient.Text) > ClientMax Then
Txtnoclient.Text = ClientMax
End If
End Sub

Private Sub txtnoclient_GotFocus()
Txtnoclient.Backcolor = &H0&
Txtnoclient.Forecolor = vbWhite
End Sub
Private Sub txtnoclient_LostFocus()
Txtnoclient.Backcolor = &H404040
Txtnoclient.Forecolor = &HC000&
End Sub

